package com.cjm.algorithm.queue;

import java.util.Enumeration;
import java.util.LinkedList;
import java.util.Stack;

public class StatckQueueTest {
    public static void main(String[] args) {
        LinkedList<String> linkedList = new LinkedList<>();
        linkedList.addFirst("a");
        linkedList.addFirst("b");
        linkedList.addFirst("c");


        linkedList.addLast("ii");
        linkedList.addLast("jj");
        linkedList.addLast("kk");

        System.err.println(linkedList.peekFirst());
        System.err.println(linkedList.pollFirst());
    }

    private static void extracted() {
        Stack<String> stack = new Stack();
        stack.push("a");
        stack.push("d");
        stack.add("b");
        stack.addElement("c");
        System.err.println(stack.search("a"));
        Enumeration<String> elements = stack.elements();
        while (elements.hasMoreElements()) {
            String s = elements.nextElement();
            System.err.println(s);
        }

        String peek = stack.peek();
        String pop = stack.pop();
        System.err.println("ok");
    }
}
